import Taro, { Component } from '@tarojs/taro'
import { View, Text } from '@tarojs/components'
import './illhistory.css'
import { AtSteps,AtTextarea,AtButton,AtCheckbox } from 'taro-ui'
import {$redirectTo} from '../../../global'
export default class IllHistory extends Component {

  config = {
    navigationBarTitleText: '快速问诊'
  }
  constructor () {
    super(...arguments)
    this.state = {
      current: 5,
      value: '',
      checkedList: ['list1'],
      checkedListTwo:['list1']
    }
    this.checkboxOption = [{
      value: 'list1',
      label: '糖尿病'
    },{
      value: 'list2',
      label: '高血压'
    },{
      value: 'list3',
      label: '心脏病'
    },{
      value: 'list4',
      label: '哮喘'
   },{
    value: 'list5',
    label: '其他'
}]
  this.checkboxOptionTwo = [{
    value: 'list1',
    label: '肝炎'
  },{
    value: 'list2',
    label: '肺结核'
  },{
    value: 'list3',
    label: '其他'
}]
  
  }
  onChange (current) {
    this.setState({
      current
    })
  }
  handleChange (event) {
    this.setState({
      value: event.target.value,
      checkedList: value
    })
  }
  handleChangeTwo (value) {
    this.setState({
      checkedList: value
    })
  }
  handleChangeThree (value) {
    this.setState({
      checkedListTwo: value
    })
  }
  wenti=()=>{
    app.redirectTo("../familyillhistory.1/familyillhistory")
  }
  componentWillMount () { }

  componentDidMount () { }

  componentWillUnmount () { }

  componentDidShow () { }

  componentDidHide () { }

  render () {
    const items = [
        { 'title': '' },
        { 'title': '' },
        { 'title': '' },
        { 'title': '' },
        { 'title': '' },
        { 'title': '' },
        { 'title': '' },
        { 'title': '' }
      ];
    return (
      <View className='ill-history'>
         <AtSteps
        className='steps'
        items={items}
        current={this.state.current}
        onChange={this.onChange.bind(this)}
      />
      <View className='title'>既往病史</View>
      <View className='ill-type'>
        <View className='ill-title'>慢性病史</View>
        <AtCheckbox
        options={this.checkboxOption}
        selectedList={this.state.checkedList}
        onChange={this.handleChangeTwo.bind(this)}
      />
      </View>
      <View className='ill-type'>
        <View className='ill-title'>传染病史</View>
        <AtCheckbox
        options={this.checkboxOptionTwo}
        selectedList={this.state.checkedListTwo}
        onChange={this.handleChangeThree.bind(this)}
      />
      </View>
      <View className='ill-type'>
        <View className='ill-title'>外伤，手术，输血史</View>
        <AtTextarea
        value={this.state.value}
        onChange={this.handleChange.bind(this)}
        maxLength={200}
        count={false}
        placeholder='请填写外伤，手术，输血史'
      />
      </View>
      <View className='ill-type'>
        <View className='ill-title'>重大疾病史</View>
        <AtTextarea
        value={this.state.value}
        onChange={this.handleChange.bind(this)}
        maxLength={200}
        count={false}
        placeholder='请填写重大疾病历史'
      />
      </View>
      <View className='ill-type'>
        <View className='ill-title'>肝肾功能状况</View>
        <AtTextarea
        value={this.state.value}
        onChange={this.handleChange.bind(this)}
        maxLength={200}
        count={false}
        placeholder='请填写肾功能状况'
      />
      </View>
      <View className='ill-type'>
        <View className='ill-title'>放化疗</View>
        <AtTextarea
        value={this.state.value}
        onChange={this.handleChange.bind(this)}
        maxLength={200}
        count={false}
        placeholder='请填写放化疗史'
      />
      </View>
      <View className='ill-type'>
        <View className='ill-title'>过敏史</View>
        <AtTextarea
        value={this.state.value}
        onChange={this.handleChange.bind(this)}
        maxLength={200}
        count={false}
        placeholder='请填写过敏史，填写致使过敏的药物，食物'
      />
      </View>
      <View className='blank-box'></View>
      <View className='btn-box'><AtButton className='next-btn' onClick={this.wenti} full>下一步</AtButton></View>
      </View>
    )
  }
}

